export interface Rule {
  required?: boolean
  type?:
    | 'string'
    | 'number'
    | 'boolean'
    | 'method'
    | 'regexp'
    | 'integer'
    | 'float'
    | 'array'
    | 'object'
    | 'enum'
    | 'date'
    | 'url'
    | 'hex'
    | 'email'
  message?: string
  trigger?: 'blur' | 'change'
  validator?: (rule: any, value: any, callback?: () => any) => never
}
export interface FormJsonItem {
  type: 'input' | 'select' | 'date' | 'radio'
  label: string
  prop: string
  placeholder?: string
  required: boolean
  other?: Record<string, any>
  options?: { value: number | string; label: string }[]
  rules?: Rule | Array<Rule>
}

export type FormJson = Array<FormJsonItem>

export * as default from './BaseForm'
